<template>
  <div>
    <a-table
      ref="table"
      size="middle"
      bordered
      rowlangKey="id"
       class="table_header_blue"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
      @change="handleTableChange"
    >
      <span slot="actionName">
        <a-upload v-if="stage !== '05010' && stage !== '05050'"
                  :data="fileData" name="files" :showUploadList="false" :multiple="false"
                  :headers="tokenHeader" accept=".docx, .doc, .xlsx, .xls, .pdf, .jpeg, .png"
                  :action="url.upLoad" @change="handleImportExcel">
          <a-button size="small" type="primary" icon="import">上传</a-button>
        </a-upload>
        <span v-else>操作</span>
      </span>
      <span slot="action" slot-scope="text, record">
          <a @click="OnPerview(record)">预览</a>
          <a-divider type="vertical"/>
          <a @click="OnDownLoad(record)">下载</a>
          <a-divider v-if="stage !== '05010' && stage !== '05050'" type="vertical"/>
          <a-popconfirm v-if="stage !== '05010' && stage !== '05050'" title="确定删除吗?"
                        @confirm="() => handleDelete(record.id)">
            <a>删除</a>
          </a-popconfirm>
        </span>
    </a-table>
  </div>
</template>
<script>
  import {filePerviewMixin} from '@/mixins/filePerviewMixin'
  import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  import {getAction, httpAction} from '@/api/manage'
  import columns from './indexColumns'

  export default {
    name: "sjtzs",
    mixins: [JeecgListMixin, filePerviewMixin],
    props: ['id', 'stage', 'type'],
    components: {},
    data() {
      return {
        queryParam: {
          id: this.id,
        },
        typeId: this.type,
        fileData: {
          biz: 'zgbg',
          type: 'zgbg',
          proId: this.id,
        },
        //表头
        columns: columns(this),
        url: {
          list: '/sjxmzygl/sjWorkBaogaoZg/queryZgInfo',
          delete: '/sjxmzygl/sjWorkBaogaoZg/delete',
          upLoad: `${window._CONFIG['domianURL']}/zg/upload/sjZgbgUpload`,
        },
      }
    },
    created() {
    },
    methods: {}
  }
</script>

<style lang="less" scoped>
@import '~@assets/less/tableTheme.less';
  .funBtn {
    padding: 0 10px;
    margin-left: 10px;
  }
</style>